package cn.hg.solon.youcan.system.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class SysUserOnlineTableDef extends TableDef {

    /**
     * 实体类。

 @author 胡高
 @since 2023-06-20
     */
    public static final SysUserOnlineTableDef SYS_USER_ONLINE = new SysUserOnlineTableDef();

    /**
     * 用户会话id
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 登录IP地址
     */
    public final QueryColumn IP = new QueryColumn(this, "ip");

    /**
     * 操作系统
     */
    public final QueryColumn OS = new QueryColumn(this, "os");

    /**
     * 登录设备
     */
    public final QueryColumn DEVICE = new QueryColumn(this, "device");

    /**
     * ON：在线，OFF：离线
     */
    public final QueryColumn STATUS = new QueryColumn(this, "status");

    /**
     * 用户ID
     */
    public final QueryColumn USER_ID = new QueryColumn(this, "user_id");

    /**
     * 浏览器类型
     */
    public final QueryColumn BROWSER = new QueryColumn(this, "browser");

    /**
     * 部门名称
     */
    public final QueryColumn DEPT_NAME = new QueryColumn(this, "dept_name");

    /**
     * 登录地点
     */
    public final QueryColumn LOCATION = new QueryColumn(this, "location");

    /**
     * 用户昵称
     */
    public final QueryColumn NICKNAME = new QueryColumn(this, "nickname");

    /**
     * 超时时间(秒)
     */
    public final QueryColumn EXPIRE_SECOND = new QueryColumn(this, "expire_second");

    /**
     * session创建时间
     */
    public final QueryColumn START_DATETIME = new QueryColumn(this, "start_datetime");

    /**
     * session最后访问时间
     */
    public final QueryColumn ACTIVITY_DATETIME = new QueryColumn(this, "activity_datetime");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, IP, OS, DEVICE, STATUS, USER_ID, BROWSER, DEPT_NAME, LOCATION, NICKNAME, EXPIRE_SECOND, START_DATETIME, ACTIVITY_DATETIME};

    public SysUserOnlineTableDef() {
        super("", "sys_user_online");
    }

    private SysUserOnlineTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public SysUserOnlineTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new SysUserOnlineTableDef("", "sys_user_online", alias));
    }

}
